<?php
namespace Home\Model;
use Think\Model;
class SortModel extends Model {
    public function addSortByData($data){
        $this->data($data)->add();
    }

//    public function deleteAllSort(){
//        return $this->delete();
//    }

    public function deleteSortById($id){
        return $this->delete($id);
    }

    public function updateSortById($id,$data){
        $this->where("id='$id'")->save($data);
    }

    public function getAllSort(){
        return $this->select();
    }

    public function getSortBySortName($name){
        return $this->where("name='$name'")->select();
    }

    public function getSortById($id){
        return $this->where("id='$id'")->select();
    }

    public function getSortByName($name){
        return $this->where("name='$name'")->select();
    }

}